var t = require;
var e = module;
var o = exports;
var i, n = this && this.__extends || (i = function(t, e) {
    return (i = Object.setPrototypeOf || {
        __proto__: []
    }
    instanceof Array &&
    function(t, e) {
        t.__proto__ = e
    } ||
    function(t, e) {
        for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
    })(t, e)
},
function(t, e) {
    function o() {
        this.constructor = t
    }
    i(t, e),
    t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
}),
a = this && this.__decorate ||
function(t, e, o, i) {
    var n, a = arguments.length,
    r = a < 3 ? e: null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);
    else for (var s = t.length - 1; s >= 0; s--)(n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
    return a > 3 && r && Object.defineProperty(e, o, r),
    r
};
Object.defineProperty(o, "__esModule", {
    value: !0
});
var r = cc._decorator,
s = r.ccclass,
l = r.property,
c = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.ySpeed = 50,
        e.posY = void 0,
        e.unit = 1,
        e.gravity = 0,
        e.rotSpeed = 1e3,
        e._isWave = !0,
        e
    }
    return n(e, t),
    Object.defineProperty(e.prototype, "Speed", {
        set: function(t) {
            this.ySpeed = t
        },
        enumerable: !1,
        configurable: !0
    }),
    e.prototype.setCustomPropre = function(t, e) {
        var o = this;
        this._isWave = !1,
        this.ySpeed = e,
        this.scheduleOnce(function() {
            o._isWave = !0
        },
        t)
    },
    e.prototype.start = function() {
        this.posY = this.node.y
    },
    e.prototype.strike = function() {
        this.unit = 1,
        this.ySpeed = 2300,
        this.gravity += 3
    },
    e.prototype.wave = function() {
        this.node.y >= this.posY + 100 && (this.unit = -1),
        this.node.y <= this.posY - 100 && (this.unit = 1)
    },
    e.prototype.update = function(t) {
        this._isWave && (this.isHit ? (this.node.angle += this.rotSpeed * t, this.strike()) : this.wave(), this.node.y += this.ySpeed * this.unit * t - this.gravity)
    },
    a([l(cc.Float)], e.prototype, "ySpeed", void 0),
    a([s], e)
} (cc.Component);
o.default = c